<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div class="columns pull-right" role="group">
							<button class="btn btn-success" onclick="reLoad()">
								<i class="fa fa-search" aria-hidden="true"></i>查询
							</button>
							<button class="btn btn-danger" onclick="exportBalances()" shiro:hasPermission="finance:balance:export">
								<i class="fa fa-mail-reply-all" aria-hidden="true"></i>导出
							</button>
						</div>

						<div class="columns pull-left col-md-3 nopadding" shiro:hasPermission="finance:balance:excelRecharge">
							<form action="/finance/balance/batchRecharge" id="batchRecharge" enctype="multipart/form-data" method="post">
								<div class="columns pull-left col-md-6">
									<input type="file" class="form-control" id="excelFile" name="excelFile">
								</div>
								<div class="columns pull-left col-md-3" style="padding-left: 0px;">
									<button class="btn btn-success" style="float: left" type="button" id="upload">
										<i class="fa fa-plus" aria-hidden="true"></i>批量充值
									</button>
								</div>
								<div class="columns pull-left col-md-3" style="padding-left: 0px;">
									<a href="/files/批量充值模板.xlsx"><u>充值模板</u></a>
								</div>

							</form>
						</div>

						<div class="pull-right search col-md-2 nopadding">
							<input id="queryItem" type="text" class="form-control" placeholder="会员ID/姓名/昵称/手机">
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control"
								   id="end" name="end" placeholder="请选择结束日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<div class="columns pull-right">
							<label style="font-weight: 700;float: left;padding: 3px 10px;line-height: 2;font-size: 15px">
								<i class="fa fa-exchange"></i>
							</label>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control"
								   id="start" name="start" placeholder="请选择开始日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<select data-placeholder="" class="form-control chosen-select" id="role" name="role" tabindex="2">
								<option value="" selected="selected">--等级--</option>
								<option value="0">会员</option>
								<option value="3">门店</option>
							</select>
						</div>

						<input type="hidden" name="centreId" th:value="${centreId}" th:if="${flag} == '1'">
						<div class="columns pull-right col-md-1 nopadding" th:if="${flag} == '0'">
							<select data-placeholder="商户" class="form-control chosen-select" name="centreId" tabindex="2">
								<option value="">选择商户</option>
								<option th:each="item: ${centreList}" th:text="${item.name}" th:value="${item.centreId}"></option>
							</select>
						</div>
					</div>
					<table id="balanceTable" data-mobile-responsive="true"></table>
					<div class="columns pull-left col-md-3 nopadding">
						<span style="color:#ff542d;font-size: 16px;"  id="totalInfo"></span>
					</div>
				</div>
			</div>
		</div>

		<div>
			<script type="text/javascript">
				var s_recharge_h = 'hidden';
				var s_deduct_h = 'hidden';
				var s_cash_h = 'hidden';
				var s_payin_h = 'hidden';
			</script>
		</div>

		<div shiro:hasPermission="finance:balance:recharge">
			<script type="text/javascript">
				s_recharge_h = '';
			</script>
		</div>
		<div shiro:hasPermission="finance:balance:deduct">
			<script type="text/javascript">
				s_deduct_h = '';
			</script>
		</div>
		<div shiro:hasPermission="finance:balance:cash">
			<script type="text/javascript">
				s_cash_h = '';
			</script>
		</div>
		<div shiro:hasPermission="finance:balance:payin">
			<script type="text/javascript">
				s_payin_h = '';
			</script>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script type="text/javascript" src="/js/appjs/finance/balance/balances.js"></script>
</body>
</html>